import request from '@/utils/request'
import headApi from '@/utils/hade';
const head='/system'
// 上传图片通用
export function upload(query) {
  return request({
    url: headApi+'/common/upload',
    method: 'post',
    data: query
  })
}


// 平台设置提交 platform
export function comnonConfig(query) {
  return request({
    url: headApi+'/system/comnonConfig',
    method: 'post',
    data: query
  })
}
export function comnonConfigAPI(query) {
  return request({
    url: headApi+'/system/comnonConfig',
    method: 'post',
    params: query
  })
}

// 查询基础设置  tenant
export function getSetup() {     //原来名字是getInfo 
  return request({
    url: headApi+'/system/comnonConfig/getInfo',
    method: 'get',
  })
}
//新增短信配置
export function addConfig(param) {     
  return request({
    url: headApi+'/business/config/add',
    method: 'post',
    data:param
  })
}
//修改短信配置
export function editConfig(param) {     
  return request({
    url: headApi+'/business/config',
    method: 'PUT',
    data:param
  })
}
//新增短信模板
export function addTemplate(param) {     
  return request({
    url: headApi+'/business/template',
    method: 'post',
    data:param
  })
}
//修改短信模板
export function editTemplate(param) {     
  return request({
    url: headApi+'/business/template',
    method: 'put',
    data:param
  })
}
//查询短信配置
export function getConfig(param) {     
  return request({
    url: headApi+'/business/config/list',
    method: 'get',
    params:param
  })
}
//查询短信模板
export function getConfigList(param) {     
  return request({
    url: headApi+'/business/template/list',
    method: 'post',
    data:param
  })
}
//发送短信测试
export function GotestSms(param) {     
  return request({
    url: headApi+'/business/template/testSms',
    method: 'post',
    data:param
  })
}
//短信消息库状态  启用  禁用
export function updateSmsTemplateState(param) {     
  return request({
    url: headApi+'/business/template/updateSmsTemplateState',
    method: 'post',
    data:param
  })
}
//短信消息库删除
export function delTemplate(param) {     
  return request({
    url: headApi+`/business/template/${param}`,
    method: 'DELETE',
  })
}
//通过邀请码来获取基础设置
export function selectByInvitationConfig(param) {  
  return request({
    url:headApi+'/selfcom/user/selectByInvitationConfig',
    method: 'get',
    params:param
  })
}
//通过网页域名来获取基础设置
export function getInfoDomain(param) {  
  return request({
    url:headApi+'/selfcom/user/getInfoDomain',
    method: 'get',
    params:param
  })
}
//用户状态获取基础设置
export function selectUserIdByConfig(param) {  
  return request({
    url:headApi+'/selfcom/user/selectUserIdByConfig',
    method: 'get',
    params:param
  })
}

// 修改基础设置
export function editAPI(query) {
  return request({
    url: headApi+'/system/comnonConfig',
    method: 'put',
    data: query
  })
}
// 获取当前用户邀请码设置
export function selectByInvitationCodeIsUserId() {
  return request({
    url: headApi+'/selfcom/user/selectByInvitationCodeIsUserId',
    method: 'get',
  })
}
// 用户管理-卡片-团队总收入
export function selectTotalRevenue(param) {
  return request({
    url: headApi+'/capUserWallet/selectTotalRevenue',
    method: 'get',
    params:param
  })
}
// 系统管理-租户设置-关于我们
export function AboutUs(param) {
  return request({
    url: headApi+'/business/us/list',
    method: 'get',
    params:param
  })
}
// 系统管理-租户设置-新增关于我们
export function AddAboutUs(param) {
  return request({
    url: headApi+'/business/us',
    method: 'post',
    data:param
  })
}
// 系统管理-租户设置-修改关于我们
export function EditAboutUs(param) {
  return request({
    url: headApi+'/business/us',
    method: 'put',
    data:param
  })
}
// 系统管理-公告-获取左边菜单栏二级菜单
export function getMenu(param) {
  return request({
    url: headApi+'/business/route/list',
    method: 'get',
    params:param
  })
}
// 系统管理-公告-新增公告
export function AddMenu(param) {
  return request({
    url: headApi+'/business/notice',
    method: 'post',
    data:param
  })
}
// 系统管理-公告-获取所有公告
export function getMenuList(param) {
  return request({
    url: headApi+'/business/notice/list',
    method: 'get',
    params:param
  })
}
// 租户设置-帮助中心-查询新手引导和常见问题
export function selectUserAgreementsPagingSpecial(param) {
  return request({
    url: headApi+'/userAgreement/selectUserAgreementsPagingSpecial',
    method: 'post',
    data:param
  })
}
// 系统管理-公告-删除公告
export function delMenu(param) {
  return request({
    url: headApi+`/business/notice/${param}`,
    method: 'DELETE',
  })
}
// 系统管理-公告-编辑公告
export function editMenu(param) {
  return request({
    url: headApi+`/business/notice`,
    method: 'put',
    data:param
  })
}
// 系统管理-版本管理-新增版本
export function addVersion(param) {
  return request({
    url: headApi+`/business/version`,
    method: 'post',
    data:param
  })
}
// 系统管理-版本管理-编辑版本
export function editVersion(param) {
  return request({
    url: headApi+`/business/version`,
    method: 'put',
    data:param
  })
}
// 系统管理-版本管理-删除版本
export function delVersion(param) {
  return request({
    url: headApi+`/business/version/remove`,
    method: 'get',
    params:param
  })
}
// 系统管理-版本管理-查询版本列表
export function selectSysVersionListPage(param) {
  return request({
    url: headApi+`/business/version/selectSysVersionListPage`,
    method: 'post',
    data:param
  })
}
// 系统管理-协议-新增协议
export function insertUserAgreement(param) {
  return request({
    url: headApi+`/userAgreement/insertUserAgreement`,
    method: 'post',
    data:param
  })
}
// 系统管理-协议-查询协议列表
export function selectUserAgreements(param) {
  return request({
    url: headApi+`/userAgreement/selectUserAgreements`,
    method: 'post',
    data:param
  })
}
// 系统管理-协议-ID查询协议列表
export function getSelectUserAgreement(param) {
  return request({
    url: headApi+`/userAgreement/selectUserAgreement/${param}`,
    method: 'get',
  })
}
// 系统管理-协议-编辑协议
export function editUserAgreement(param) {
  return request({
    url: headApi+`/userAgreement/editUserAgreement`,
    method: 'post',
    data:param
  })
}
// 系统管理-协议-删除协议
export function deleteUserAgreement(param) {
  return request({
    url: headApi+`/userAgreement/deleteUserAgreement/${param}`,
    method: 'get',
  })
}
// 系统管理-网络配置-域名检查
export function inspectDomain(param) {
  return request({
    url: headApi+`/domain/domain/inspectDomain`,
    method: 'get',
    params:param
  })
}
// 系统管理-网络配置-保存检测成功后的域名
export function addDomain(param) {
  return request({
    url: headApi+`/domain/domain`,
    method: 'post',
    data:param
  })
}
// 系统管理-网络配置-查询域名
export function getDomain(param) {
  return request({
    url: headApi+`/domain/domain/list`,
    method: 'post',
    data:param
  })
}
// 系统管理-网络配置-删除域名
export function delDomain(param) {
  console.log(param,'999888删除')
  return request({
    url: headApi+`/domain/domain/${param}`,
    method: 'DELETE',
  })
}
// 所有页面共用-公告弹窗--用户状态下
export function MenuPop(param) {
  return request({
    url: headApi+`/business/notice/selectSysNoticeByRoute`,
    method: 'get',
    params:param
  })
}
// 所有页面共用-公告弹窗--用户状态下
export function chart(param) {
  return request({
    url: headApi+`/tenant/getExpenditureStatisticsInfo`,
    method: 'get',
    params:param
  })
}








